#pragma once
#include "dllmain.h"
#include "fuSingleton.hpp"
#include <boost/scoped_ptr.hpp>
#include <ostream>
#include <string>
#include <vector>

BEGIN_NAMESPACE_CPPX

class fuError
{
    friend class fuLogger;
    std::string _error;
public:
	fuError(const std::string & error) : _error(error) {}
	~fuError(void){}
};

class fuEnter
{
public:
	fuEnter(void){}
	~fuEnter(void){}
};

class _CPPX_API fuLogger : public fuSingleton<fuLogger>
{
	//typedef ostream::__ostream_fn __ostream_fn;

	struct pimpl_t;
	boost::scoped_ptr<pimpl_t> pimpl_ptr;

public:
	fuLogger(void);											        // Init logger system with cout stream by default.
	fuLogger(const std::string & out_filename);					    // Init logger system with user defined text file.
	fuLogger(std::ostream * out_stream, bool ower_manage = false ); // Init logger system with user defined streambuf object and managed or not.
	~fuLogger(void);

	//fuLogger & operator << ( __ostream_fn _fn);
    fuLogger & operator << ( const fuError & err );
	fuLogger & operator << ( const fuEnter & enter );
    fuLogger & operator << ( const std::vector<char> & dat );
    fuLogger & operator << ( const std::string & str );
    fuLogger & operator << ( const char * str );
    fuLogger & operator << ( int num );
    fuLogger & operator << ( unsigned int num );
    fuLogger & operator << ( float num );
    fuLogger & operator << ( double num );

	std::ostream & get_ostream(void);
};

_CPPX_API fuLogger * fuLoggerPtr(void);
_CPPX_API fuLogger & fuLoggerRef(void);

END_NAMESPACE_CPPX
